﻿using Nydus.Model.Entities;
using System.Collections.Generic;
using System.Data.Objects;

namespace Nydus.Model.Interfaces
{
    /// <summary>
    /// Represents the Nydus data context.
    /// </summary>
    public interface INydusDataContext
    {
        /// <summary>
        /// Get the Agents object set.
        /// </summary>
        IObjectSet<Agent> Agents { get; }

        /// <summary>
        /// Get the AgentGroups object set.
        /// </summary>
        IObjectSet<AgentGroup> AgentGroups { get; }

        /// <summary>
        /// Get the Calls object set.
        /// </summary>
        IObjectSet<Call> Calls { get; }

        /// <summary>
        /// Get the Customers object set.
        /// </summary>
        IObjectSet<Customer> Customers { get; }

        /// <summary>
        /// Get the Requests object set.
        /// </summary>
        IObjectSet<Request> Requests { get; }

        /// <summary>
        /// Get the Tasks object set.
        /// </summary>
        IObjectSet<Task> Tasks { get; }

        /// <summary
        /// Saves all changes.
        /// </summary>
        /// <returns></returns>
        string Save();

        /// <summary>
        /// Gets the managed entities collection.
        /// </summary>
        /// <typeparam name="T">Managed entity type</typeparam>
        /// <returns>Managed entity collection.</returns>
        IEnumerable<T> GetManagedEntities<T>();
    }
}
